home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / wtek0693.zip / OOPALLEY.ZIP / DICT.H < prev    next >
C/C++ Source or Header  |  1993-04-27  |  2KB  |  47 lines

  1. #ifndef DICTIONARY_H
  2. #define DICTIONARY_H
  3.  
  4. #include "set.h"
  5.  
  6. extern const Class class_Dictionary;
  7.  
  8. class LookupKey;
  9. class Assoc;
  10. class OrderedCollection;
  11.  
  12. ////////////////////////////////////////////////////////////
  13. // class Dictionary (declaration)
  14. ////////////////////////////////////////////////////////////
  15. class Dictionary: public Set {
  16. public:
  17.                 // constructors, destructors
  18.                 Dictionary(unsigned size =CLTN_DEFAULT_CAPACITY);
  19.                 Dictionary(const Dictionary&);
  20.  
  21.                 // operators
  22.     void        operator=(const Dictionary&);
  23.     bool        operator==(const Dictionary&) const;
  24.     bool        operator!=(const Dictionary& d) const    { return !(*this == d); }
  25.  
  26.     virtual Object*         add(const Object&);
  27.     virtual Assoc*          addAssoc(const Object& key, const Object& value);
  28.     virtual Collection&     addContentsTo(Collection&) const;
  29.     virtual Collection&     addKeysTo(Collection&) const;
  30.     virtual Collection&     addValuesTo(Collection&) const;
  31.     virtual LookupKey&      assocAt(const Object& key) const;
  32.     virtual Object*         atKey(const Object& key) const;
  33.     virtual Object*         atKey(const Object& key, const Object& newValue);
  34.     virtual bool            includesAssoc(const LookupKey& asc) const;
  35.     virtual bool            includesKey(const Object& key) const;
  36.     virtual const Class*    isA() const;
  37.     virtual bool            isEqual(const Object&) const;
  38.     virtual Object*         keyAtValue(const Object& val) const;
  39.     virtual unsigned        occurrencesOf(const Object& val) const;
  40.     virtual Object*         remove(const Object& asc);
  41.     virtual LookupKey&      removeAssoc(const LookupKey& asc);
  42.     virtual LookupKey&      removeKey(const Object& key);
  43.     virtual const Class*    species() const;
  44. };
  45.  
  46. #endif
  47.